package com.gzs.zhdj.mapper;

import com.github.pagehelper.Page;
import com.gzs.zhdj.domain.dto.AnswerDto;
import com.gzs.zhdj.domain.dto.QAPageDto;
import com.gzs.zhdj.domain.dto.QuestionDto;
import com.gzs.zhdj.domain.entity.PartyMember;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface QAMapper {

    @Insert("insert into questions_answers(q_pid, question,category, quest_time) values (#{qPid},#{question},#{category},#{questTime})")
    void quest(QuestionDto questionDto);

    @Update("update questions_answers set a_pid = #{aPid}, answer = #{answer}, answer_time = #{answerTime} where id = #{id}")
    void Answer(AnswerDto answerDto);

    @Update("update questions_answers set status = 1 where id = #{id}")
    void updateStatus(int id);

    Page<PartyMember> pageQuery(QAPageDto qaPageDto);
}
